package org.example.commonapi.dto.onlineCode;

import lombok.Data;
import org.example.commonapi.domain.onlineCode.CodeTopic;

import java.util.List;

@Data
public class CodeTopicDTO {
    /**
     * mongo主健
     */
    private String id;
    /**
     * 题目id
     */
    private Integer codeId;
    /**
     * 题目标题
     */
    private String title;
    /**
     * 标签
     */
    private List<String> tags;
    /**
     * 难度系数 1-5⭐
     */
    private Integer difficulty;
    /**
     * 难度名称 1简单、2-3中等、4-5困难
     */
    private String difficultyName;
    /**
     * 问题描述
     */
    private String description;
    /**
     * 注释
     */
    private String note;
    /**
     * 创建时间
     */
    private String createTime;
    /**
     * 更新时间
     */
    private String updateTime;
    /**
     * 创建人
     */
    private String createBy;
    /**
     * 更新人
     */

    private String updateBy;

    /**
     * 是否禁用 0未禁用 1已禁用
     */
    private Integer isBan;

    /**
     * 题目是否创建完成 false 未创建 true 已创建
     */
    private Boolean isCreated;

    /**
     * 提交次数
     */
    private Integer commitNum;

    /**
     * 通过次数
     */
    private Integer passNum;

    /**
     * 时间限制
     */
    private String  timeLimit;

    /**
     * 内存限制
     */
    private String  memoryLimit;

    private Boolean status;

    public CodeTopicDTO(CodeTopic codeTopic, boolean status) {
        this.id = codeTopic.getId();
        this.codeId = codeTopic.getCodeId();
        this.title = codeTopic.getTitle();
        this.tags = codeTopic.getTags();
        this.difficulty = codeTopic.getDifficulty();
        this.difficultyName = codeTopic.getDifficultyName();
        this.description = codeTopic.getDescription();
        this.note = codeTopic.getNote();
        this.createTime = codeTopic.getCreateTime();
        this.updateTime = codeTopic.getUpdateTime();
        this.createBy = codeTopic.getCreateBy();
        this.updateBy = codeTopic.getUpdateBy();
        this.isBan = codeTopic.getIsBan();
        this.isCreated = codeTopic.getIsCreated();
        this.commitNum = codeTopic.getCommitNum();
        this.passNum = codeTopic.getPassNum();
        this.timeLimit = codeTopic.getTimeLimit();
        this.memoryLimit = codeTopic.getMemoryLimit();
        this.status = status;
    }
}